/*
 * Copyright (c)  2015~2020, xforceplus
 * All rights reserved.
 * Project:datacare-orm
 * Id: ConnectionSourceHelper.java   2020-10-05 14-16-02
 * Author: Evan
 */
package cn.datacare.orm.connection;

import javax.sql.DataSource;

/**
 * <p>
 * Title:
 * </p>
 * <p>
 * Description:
 * </p>
 * <p>
 * Copyright: 2015~2020
 * </p>
 * <p>
 * Company/Department: xforceplus
 * </p>
 *
 * @author Evan
 * <b>Creation Time:</b> 2020-10-05 14-16-02
 * @since V1.0
 */
public class ConnectionSourceHelper {
    public  static ConnectionSource getSingle(DataSource ds){
        return new DefaultConnectionSource(ds,null);
    }
    public  static ConnectionSource getMasterSlave(DataSource ds,DataSource[] slaves){
        return new DefaultConnectionSource(ds,slaves);
    }
    /**
     *  多余参数 dbName
     * @param driver
     * @param url
     * @param dbName 多余了
     * @param userName
     * @param password
     * @return
     */
    @Deprecated
    public static ConnectionSource getSimple(String driver,String url,String dbName,String userName,String password){
        return new SimpleConnectionSource(driver,url,userName,password);
    }

    public static ConnectionSource getSimple(String driver,String url,String userName,String password){
        return new SimpleConnectionSource(driver,url,userName,password);
    }
}


